namespace ext.data
{
	using System;
	using System.Runtime.CompilerServices;
	using System.Html;
	using System.Collections;
	
	
	/// <summary>
	/// An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain
	/// other than the originating domain of the running page.
	/// </summary>
	/// <htmlSummary>
	/// An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain
	/// other than the originating domain of the running page.&lt;br&gt;
	/// &lt;p&gt;
	/// &lt;b&gt;Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain
	/// of the running page, you must use this class, rather than HttpProxy.&lt;/b&gt;&lt;br&gt;
	/// &lt;p&gt;
	/// The content passed back from a server resource requested by a ScriptTagProxy &lt;b&gt;must&lt;/b&gt; be executable JavaScript
	/// source code because it is used as the source inside a &amp;lt;script&gt; tag.&lt;br&gt;
	/// &lt;p&gt;
	/// In order for the browser to process the returned data, the server must wrap the data object
	/// with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.
	/// Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy
	/// depending on whether the callback name was passed:
	/// &lt;p&gt;
	/// &lt;pre&gt;&lt;code&gt;
	/// boolean scriptTag = false;
	/// String cb = request.getParameter(&quot;callback&quot;);
	/// if (cb != null) {
	/// scriptTag = true;
	/// response.setContentType(&quot;text/javascript&quot;);
	/// } else {
	/// response.setContentType(&quot;application/x-json&quot;);
	/// }
	/// Writer out = response.getWriter();
	/// if (scriptTag) {
	/// out.write(cb + &quot;(&quot;);
	/// }
	/// out.print(dataBlock.toJsonString());
	/// if (scriptTag) {
	/// out.write(&quot;);&quot;);
	/// }
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;p&gt;Below is a PHP example to do the same thing:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
	/// $callback = $_REQUEST[&apos;callback&apos;];
	///
	/// // Create the output object.
	/// $output = array(&apos;a&apos; =&gt; &apos;Apple&apos;, &apos;b&apos; =&gt; &apos;Banana&apos;);
	///
	/// //start output
	/// if ($callback) {
	/// header(&apos;Content-Type: text/javascript&apos;);
	/// echo $callback . &apos;(&apos; . json_encode($output) . &apos;);&apos;;
	/// } else {
	/// header(&apos;Content-Type: application/x-json&apos;);
	/// echo json_encode($output);
	/// }
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;p&gt;Below is the ASP.Net code to do the same thing:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
	/// String jsonString = &quot;{success: true}&quot;;
	/// String cb = Request.Params.Get(&quot;callback&quot;);
	/// String responseString = &quot;&quot;;
	/// if (!String.IsNullOrEmpty(cb)) {
	/// responseString = cb + &quot;(&quot; + jsonString + &quot;)&quot;;
	/// } else {
	/// responseString = jsonString;
	/// }
	/// Response.Write(responseString);
	/// &lt;/code&gt;&lt;/pre&gt;
	/// </htmlSummary>
	/// <definedin>src\data\ScriptTagProxy.js</definedin>
	[ScriptName("ScriptTagProxy")]
	[ScriptNamespace("Ext.data")]
	[Imported()]
	public partial class ScriptTagProxy : ext.data.DataProxy
	{
		
		#region Constructors
		/// <summary>Constructor</summary>
		/// <param name="config">A configuration object.</param>
		public ScriptTagProxy(ext.data.ScriptTagProxy_Configuration config)
		{
		}
		
		/// <summary>Constructor</summary>
		public ScriptTagProxy()
		{
		}
		#endregion
		
		#region Fields
		/// <summary>
		/// Deprecated in favor of &apos;exception&apos; event.
		/// Fires if an exception occurs in the Proxy during data loading. This event can be fired for one of two reasons:
		///  The load call timed out. This means the load callback did not execute within the time limit
		/// specified by {@link #timeout}. In this case, this event will be raised and the
		/// fourth parameter (read error) will be null.  The load succeeded but the reader could not read the response. This means the server returned
		/// data, but the configured Reader threw an error while reading the data. In this case, this event will be
		/// raised and the caught error will be passed along as the fourth parameter of this event.  
		/// Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly
		/// on any Store instance.
		/// </summary>
		/// <htmlSummary>
		/// &lt;b&gt;Deprecated&lt;/b&gt; in favor of &apos;exception&apos; event.
		/// Fires if an exception occurs in the Proxy during data loading. This event can be fired for one of two reasons:
		/// &lt;ul&gt;&lt;li&gt;&lt;b&gt;The load call timed out.&lt;/b&gt; This means the load callback did not execute within the time limit
		/// specified by {@link #timeout}. In this case, this event will be raised and the
		/// fourth parameter (read error) will be null.&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;The load succeeded but the reader could not read the response.&lt;/b&gt; This means the server returned
		/// data, but the configured Reader threw an error while reading the data. In this case, this event will be
		/// raised and the caught error will be passed along as the fourth parameter of this event.&lt;/li&gt;&lt;/ul&gt;
		/// Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly
		/// on any Store instance.
		/// </htmlSummary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		[ScriptName("loadexceptionEventName")]
		public const string LoadexceptionEventName = "loadexception";
		
		/// <summary>The URL from which to request the data object.</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		[ScriptName("url")]
		public string Url;
		
		/// <summary>The number of milliseconds to wait for a response. Defaults to 30 seconds.</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("timeout")]
		public System.Number Timeout;
		
		/// <summary>
		/// The name of the parameter to pass to the server which tells
		/// the server the name of the callback function set up by the load call to process the returned data object.
		/// Defaults to &quot;callback&quot;. The server-side processing must read this parameter value, and generate
		/// javascript output which calls this named function passing the data object as its only parameter.
		/// </summary>
		/// <htmlSummary>
		/// The name of the parameter to pass to the server which tells
		/// the server the name of the callback function set up by the load call to process the returned data object.
		/// Defaults to &quot;callback&quot;.&lt;p&gt;The server-side processing must read this parameter value, and generate
		/// javascript output which calls this named function passing the data object as its only parameter.
		/// </htmlSummary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("callbackParam")]
		public string CallbackParam;
		
		/// <summary>
		/// Defaults to true. Disable caching by adding a unique parameter
		/// name to the request.
		/// </summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("nocache")]
		public bool Nocache;
		#endregion
		
		#region Methods
		/// <summary>Callback for read actions</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <param name="action">[Ext.data.Api.actions.create|read|update|destroy]</param>
		/// <param name="trans">The request transaction object</param>
		/// <param name="res">The server response</param>
		[ScriptName("onRead")]
		public void OnRead(string action, object trans, object res)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Callback for write actions</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <param name="action">[Ext.data.Api.actions.create|read|update|destroy]</param>
		/// <param name="trans">The request transaction object</param>
		/// <param name="res">The server response</param>
		[ScriptName("onWrite")]
		public void OnWrite(string action, object trans, object res)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Abort the current server request.</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		[ScriptName("abort")]
		public void Abort()
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>HttpProxy implementation of DataProxy#doRequest</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <param name="action"></param>
		/// <param name="rs">If action is &lt;tt&gt;read&lt;/tt&gt;, rs will be null</param>
		/// <param name="params">
		/// An object containing properties which are to be used as HTTP parameters
		/// for the request to the remote server.
		/// </param>
		/// <param name="reader">
		/// The Reader object which converts the data
		/// object into a block of Ext.data.Records.
		/// </param>
		/// <param name="callback">
		/// The function into which to pass the block of Ext.data.Records.
		/// The function must be passed &lt;ul&gt;
		/// &lt;li&gt;The Record block object&lt;/li&gt;
		/// &lt;li&gt;The &quot;arg&quot; argument from the load function&lt;/li&gt;
		/// &lt;li&gt;A boolean success indicator&lt;/li&gt;
		/// &lt;/ul&gt;
		/// </param>
		/// <param name="scope">The scope (<c>this</c> reference) in which the callback function is executed. Defaults to the browser window.</param>
		/// <param name="arg">An optional argument which is passed to the callback as its second parameter.</param>
		[ScriptName("doRequest")]
		public void DoRequest(string action, ext.data.RecordClass rs, object @params, ext.data.DataReader reader, System.Delegate callback, object scope, object arg)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>HttpProxy implementation of DataProxy#doRequest</summary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		/// <param name="action"></param>
		/// <param name="rs">If action is &lt;tt&gt;read&lt;/tt&gt;, rs will be null</param>
		/// <param name="params">
		/// An object containing properties which are to be used as HTTP parameters
		/// for the request to the remote server.
		/// </param>
		/// <param name="reader">
		/// The Reader object which converts the data
		/// object into a block of Ext.data.Records.
		/// </param>
		/// <param name="callback">
		/// The function into which to pass the block of Ext.data.Records.
		/// The function must be passed &lt;ul&gt;
		/// &lt;li&gt;The Record block object&lt;/li&gt;
		/// &lt;li&gt;The &quot;arg&quot; argument from the load function&lt;/li&gt;
		/// &lt;li&gt;A boolean success indicator&lt;/li&gt;
		/// &lt;/ul&gt;
		/// </param>
		/// <param name="scope">The scope (<c>this</c> reference) in which the callback function is executed. Defaults to the browser window.</param>
		/// <param name="arg">An optional argument which is passed to the callback as its second parameter.</param>
		[ScriptName("doRequest")]
		public void DoRequest(string action, ext.data.RecordClass[] rs, object @params, ext.data.DataReader reader, System.Delegate callback, object scope, object arg)
		{
			throw new System.Exception("Imported - not implemented");
		}
		#endregion
		
		#region Events
		/// <summary>
		/// Deprecated in favor of &apos;exception&apos; event.
		/// Fires if an exception occurs in the Proxy during data loading. This event can be fired for one of two reasons:
		///  The load call timed out. This means the load callback did not execute within the time limit
		/// specified by {@link #timeout}. In this case, this event will be raised and the
		/// fourth parameter (read error) will be null.  The load succeeded but the reader could not read the response. This means the server returned
		/// data, but the configured Reader threw an error while reading the data. In this case, this event will be
		/// raised and the caught error will be passed along as the fourth parameter of this event.  
		/// Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly
		/// on any Store instance.
		/// </summary>
		/// <htmlSummary>
		/// &lt;b&gt;Deprecated&lt;/b&gt; in favor of &apos;exception&apos; event.
		/// Fires if an exception occurs in the Proxy during data loading. This event can be fired for one of two reasons:
		/// &lt;ul&gt;&lt;li&gt;&lt;b&gt;The load call timed out.&lt;/b&gt; This means the load callback did not execute within the time limit
		/// specified by {@link #timeout}. In this case, this event will be raised and the
		/// fourth parameter (read error) will be null.&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;The load succeeded but the reader could not read the response.&lt;/b&gt; This means the server returned
		/// data, but the configured Reader threw an error while reading the data. In this case, this event will be
		/// raised and the caught error will be passed along as the fourth parameter of this event.&lt;/li&gt;&lt;/ul&gt;
		/// Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly
		/// on any Store instance.
		/// </htmlSummary>
		/// <definedin>src\data\ScriptTagProxy.js</definedin>
		[ScriptName("loadexception")]
		public event ext.auto.Delegate_ext_data_ScriptTagProxy_And_System_Object_And_System_Object_And_ext_Error Loadexception;
		#endregion
	}
}
